<?php
include "connect.php";
include "messa.php";

$Messa = new Messa();
$Messa->setId($_POST['id']);
$Messa->setName($_POST['name']);
$Messa->setEmail($_POST['email']);
$Messa->setTell($_POST['tell']);
$Messa->setContent($_POST['content']);
$Messa->setAddTime($_POST['date']);

//插入语句
$sql="insert into messa(id,name,email,tell,content,add_time) 
        values('".$Messa->getId()."','".$Messa->getName()."','
        ".$Messa->getEmail()."','".$Messa->getTell()."','
        ".$Messa->getContent()."','".$Messa->getAddTime()."')";
//执行语句
$resu=mysqli_query($link,$sql);
if($resu){
    echo "插入数据成功";
}else{
    echo "插入数据失败，失败原因：".mysqli_error($link);
}